package com.ajavaer.framework.im.easemob.request;

import com.ajavaer.framework.im.easemob.model.TargetType;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;
import java.util.Map;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class EasemobSend {

    public EasemobSend() {
    }

    public EasemobSend(EasemobMsg msg) {
        this.msg = msg;
    }

    public EasemobSend(EasemobMsg msg, Map<String, String> ext) {
        this.msg = msg;
        this.ext = ext;
    }

    /**
     * 消息体
     */
    private EasemobMsg msg;
    private Map<String, String> ext;

    /**
     * 发送的目标类型；users：给用户发消息，chatgroups：给群发消息，chatrooms：给聊天室发消息
     */
    private TargetType target_type;
    /**
     * 发送的目标；注意这里需要用数组，数组长度建议不大于20，即使只有一个用户，也要用数组 ['u1']；给用户发送时数组元素是用户名，给群组发送时，数组元素是groupid
     */
    private List<String> target;

    /**
     * 表示消息发送者;无此字段Server会默认设置为“from”:“admin”，有from字段但值为空串(“”)时请求失败
     */
    private String from;

    public TargetType getTarget_type() {
        return target_type;
    }

    public void setTarget_type(TargetType target_type) {
        this.target_type = target_type;
    }

    public List<String> getTarget() {
        return target;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public EasemobMsg getMsg() {
        return msg;
    }

    public void setMsg(EasemobMsg msg) {
        this.msg = msg;
    }

    public void setTarget(List<String> target) {
        this.target = target;
    }

    public Map<String, String> getExt() {
        return ext;
    }

    public void setExt(Map<String, String> ext) {
        this.ext = ext;
    }
}
